package com.vdong.trade.trading.service.impl;

import com.baidu.disconf.client.common.annotations.DisconfFile;
import com.baidu.disconf.client.common.annotations.DisconfFileItem;
import com.baidu.disconf.client.common.update.IDisconfUpdate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;


/**
 * @author clf
 * @Description: TradeDynamicPropertyService
 * @Date 2018/12/10 9:15
 */
@Service
@DisconfFile(filename = "application.properties")
public class TradeDynamicPropertyService implements IDisconfUpdate {

    private static Logger log = LoggerFactory.getLogger(TradeDynamicPropertyService.class);

    @Value("wechatNotifyurl")
    private String wechatNotifyurl;

    @Value("wechatUnifiedOrder")
    private String wechatUnifiedOrder;

    @Value("wechatTransfersOrder")
    private String wechatTransfersOrder;

    @Value("wechat.order.query")
    private String wechatOrderQuery;

    @Value("merchantWithdrawMinAmount")
    private String merchantWithdrawMinAmount;

    @Value("merchantWithdrawCount")
    private String merchantWithdrawCount;

    @DisconfFileItem(name = "wechat.notifyurl", associateField = "wechatNotifyurl")
    public String getWechatNotifyurl() {
        return wechatNotifyurl;
    }


    public void setWechatNotifyurl(String wechatNotifyurl) {
        this.wechatNotifyurl = wechatNotifyurl;
    }

    @DisconfFileItem(name = "wechat.unified.order", associateField = "wechatUnifiedOrder")
    public String getWechatUnifiedOrder() {
        return wechatUnifiedOrder;
    }

    public void setWechatUnifiedOrder(String wechatUnifiedOrder) {
        this.wechatUnifiedOrder = wechatUnifiedOrder;
    }

    public String getWechatTransfersOrder() {
        return wechatTransfersOrder;
    }


    @DisconfFileItem(name = "wechat.transfers.order", associateField = "wechatTransfersOrder")
    public void setWechatTransfersOrder(String wechatTransfersOrder) {
        this.wechatTransfersOrder = wechatTransfersOrder;
    }

    public String getWechatOrderQuery() {
        return wechatOrderQuery;
    }

    @DisconfFileItem(name = "wechat.order.query", associateField = "wechatOrderQuery")
    public void setWechatOrderQuery(String wechatOrderQuery) {
        this.wechatOrderQuery = wechatOrderQuery;
    }

    public String getMerchantWithdrawMinAmount() {
        return merchantWithdrawMinAmount;
    }

    @DisconfFileItem(name = "merchant.withdraw.min.amount", associateField = "merchantWithdrawMinAmount")
    public void setMerchantWithdrawMinAmount(String merchantWithdrawMinAmount) {
        this.merchantWithdrawMinAmount = merchantWithdrawMinAmount;
    }

    public String getMerchantWithdrawCount() {
        return merchantWithdrawCount;
    }

    @DisconfFileItem(name = "merchant.withdraw.count", associateField = "merchantWithdrawCount")
    public void setMerchantWithdrawCount(String merchantWithdrawCount) {
        this.merchantWithdrawCount = merchantWithdrawCount;
    }

    @Override
    public void reload() throws Exception {
        log.info("DisconfTestServiceImpl重新加载的信息为：" + toString());
    }
}
